package com.zs.leymovie.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import com.zs.leymovie.R;
import com.zs.leymovie.activity.LoginActivity;

/**
 * A simple {@link Fragment} subclass.
 * <p/>
 * 作者：舒纲聿
 * 时间：2015年8月17日20:53:28
 * 功能：我界面---私人界面-订单  会员 -优惠券  系统设置等界面
 */
public class MeFragment extends Fragment {
    @ViewInject(R.id.login_img)
    private ImageView login_img;

    @ViewInject(R.id.login)
    private Button login;

    @ViewInject(R.id.quanbudingdan)
    private RelativeLayout quanbudingdan;

    @ViewInject(R.id.daizhifu)
    private TextView daizhifu;

    @ViewInject(R.id.daipingjia)
    private TextView daipingjia;

    @ViewInject(R.id.youhuiquan)
    private RelativeLayout youhuiquan;

    @ViewInject(R.id.shezhi)
    private RelativeLayout shezhi;

    @ViewInject(R.id.huiyuanka)
    private RelativeLayout huiyuanka;


    public MeFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_me, container, false);
        ViewUtils.inject(this, view);
        return view;
    }

    @OnClick({R.id.login_img, R.id.login, R.id.quanbudingdan, R.id.daizhifu, R.id.daipingjia, R.id.youhuiquan, R.id.shezhi, R.id.huiyuanka})
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.login_img:
                login();
                break;
            case R.id.login:
                login();
                break;
            case R.id.quanbudingdan:
                login();
                break;
            case R.id.daizhifu:
                login();
                break;
            case R.id.daipingjia:
                login();
                break;
            case R.id.youhuiquan:
                login();
                break;
            case R.id.shezhi:
                login();
                break;
            case R.id.huiyuanka:
                login();
                break;
        }
    }

    private void login() {
        Intent intent = new Intent(getActivity(), LoginActivity.class);
        startActivity(intent);
    }
}
